package com.ibiaoke.boss.controller;

import com.ibiaoke.common.base.BaseController;
import com.ibiaoke.common.base.Page;
import com.ibiaoke.common.consts.CommonConsts;
import com.ibiaoke.common.response.Res;
import com.ibiaoke.system.entity.Advert;
import com.ibiaoke.system.service.AdvertService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by Administrator on 2017/6/23.
 */
@Controller
public class WxAdvertController extends BaseController{

    @Autowired
    private AdvertService advertService;


    /**
     * 查询Adver
     * @param position
     * @param page
     * @return
     */
    @ResponseBody
    @RequestMapping("/listAdvert")
    public Res listAdvert(Integer position,Page page){
        List<Advert> list = advertService.listBanner(position, CommonConsts.YES, page);
        return Res.create().addResponse("page", page).addResponse("list", list);
    }
}
